home *** CD-ROM | disk | FTP | other *** search
- /* Sample of "filesel.o", linked with filesel.o vircon.o symbol.o sort.o
- By SAKU */
- #include <stdio.h>
- #include <dir.h>
- #include <egb.h>
- #include "filesel.h"
- #include "vircon.h"
-
- #define ERR 1
- #define NOERR 0
-
- char egbwork[1536];
- char moswork[4096];
-
- void init()
- {
- EGB_init( egbwork, 1536 );
- EGB_resolution( egbwork, 1, 3 );
- EGB_writePage( egbwork, 1 );
- EGB_displayPage( egbwork, 0, 3 );
-
- MOS_start( moswork );
- MOS_sysIcon( 81, 0, 0, 0 );
- MOS_color( 0, 15 );
- MOS_writePage( 1 );
-
- return;
- }
-
- void end()
- {
- MOS_disp( 0 );
- MOS_end();
- screenterm( egbwork );
- return;
- }
-
- int main( int argc, char *argv[] )
- {
- char path[256];
- char *allfile = "*.*";
- char *wild;
- int size;
-
- init();
- VC_init( egbwork, 0, 240, 60, 8, 15, 1 );
- MOS_disp( 1 );
-
- if( argc > 1 )
- wild = argv[1];
- else
- wild = allfile;
-
-
- FS_locate( 0, 0 );
-
- while(1)
- {
- if( FS_fileSelect( egbwork, wild, path ) )
- {
- end();
- return NOERR;
- }
- else
- {
- if( ( size = _get_file_size( path ) ) < 0 )
- {
- VC_printf( "\"%s\" cannot found.\n", POINTER, path );
- end();
- return ERR;
- }
- VC_printf( "select file = \"%s\"\n", POINTER, path );
- VC_printf( "filesize = %d (byte)\n", L_INT, size );
- }
- }
- }